#e
#Title[䕄up`c`v]
#Text[]
#ScriptVersion[2]

script_enemy_main
{//Enemy01
	let count=0;
	let cx=GetCenterX();//STGV[̒SxW擾
	let cy=GetCenterY();//STGV[̒SyW擾
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,3);
		SetTimer(90);
	
		SetGraphicRect(1,1,64,64);
		SetInvincibility(300);
		
		LoadGraphic(imgExRumia);	
		LoadGraphic(imgExRumiaBack);

		SetMovePosition02(cx,120,60);
		Concentration01(60);
		CutIn(YOUMU,"䕄up`c`v",0,0,0,0,0);//XyJ[h\
	}
	@MainLoop
	{
		let s=0;
		let base =GetAngleToPlayer;
		function shot(let shotid,let shotx,let shoty)
		{
				CreateShotA(shotid,shotx,shoty,10);
				SetShotDirectionType(SEQUENCE);
				SetShotDataA(shotid,0,0,0,0,0,2,YELLOW01);
				SetShotDataA(shotid,120,rand(0.5,1.5),rand(base-60,base+60),0.1,0,2,YELLOW01);
				FireShot(shotid);
		}
		if(count>=1)
		{
			if(count%180==130)
			{
				Concentration01(60);
			}
			if(count%180==0)
			{
				let po=GetY-100;
				loop(20)
				{
					shot(s,GetX-100,po);
					po+=10;
				}
			}
			if(count%180==0)
			{
				let po=GetY-100;
				loop(20)
				{
					shot(s,GetX,po);
					po+=10;
				}
			}		
			if(count%180==0)
			{
				let po=GetY+100;
				loop(20)
				{
					shot(s,GetX+100,po);
					po-=10;
				}
			}
		
			if(count%180==0)
			{
				let po=GetX-100;
				loop(20)
				{
					shot(s,po,GetY-100);
					po+=10;
				}
			}
		
			if(count%180==0)
			{
				let po=GetX+100;
				loop(20)
				{
					shot(s,po,GetY+100);
					po-=10;
				}
			}
			if(count%180==0)
			{
				let po=GetX+100;
				loop(20)
				{
					shot(s,po,GetY);
					po-=10;
				}
			}
		
			SetCollisionA(GetX(),GetY(),24);//蔻(e)o^
			SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^

		}
	count++;

	}
	@Finalize
	{//ǂ݂񂾃t@C폜
		loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
	}
	
	@DrawLoop
	{
		//Ex[~A`
		if(count<270){SetGraphicRect(64,64,127,127)};
		if(count>=270){SetGraphicRect(1,1,64,64);}
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());
	}
}